<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateShopCouponTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('shop_coupon', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('shop_coupon_id')->comment('优惠券ID');
            $table->string('shop_coupon_name')->comment('优惠券名称');
            $table->date('start_time')->nullable()->comment('优惠券时间');
            $table->date('end_time')->nullable()->comment('截至时间');
            $table->integer('satisfy_quota')->comment('满单额度');
            $table->integer('deduction_quota')->comment('减免额度');
            $table->integer('num')->default(0)->comment('发行量');
            $table->tinyInteger('status')->default(0)->comment('状态 0-下线 1-上线');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('shop_coupon');
    }
}
